﻿using System;
using System.Drawing;
using Syncfusion.Windows.PdfViewer;

namespace PdfSdk.PdfViewer
{
    public abstract class AnnotationWrapper : ObjectWrapper
    {
        public AnnotationWrapper(object obj) : base(obj)
        {
        }

        public bool Hidden
        {
            get => Convert.ToBoolean(GetPropertyValue());
            set => SetPropertyValue(value);
        }
        public string Name
        {
            get => GetPropertyValue()?.ToString();
            set => SetPropertyValue(value);
        }

        public bool IsLocked
        {
            get => Convert.ToBoolean(GetPropertyValue());
            set => SetPropertyValue(value);
        }
        public bool ReadOnly
        {
            get => Convert.ToBoolean(GetPropertyValue());
            set => SetPropertyValue(value);
        }

        public string Author
        {
            get => GetPropertyValue()?.ToString();
            set => SetPropertyValue(value);
        }
        public string Subject
        {
            get => GetPropertyValue()?.ToString();
            set => SetPropertyValue(value);
        }
        public DocumentView AnnotationParent
        {
            get => GetPropertyValue() as DocumentView;
            set => SetPropertyValue(value);
        }
        public System.Windows.Media.Color FillColor
        {
            get => (System.Windows.Media.Color)GetPropertyValue();
            set => SetPropertyValue(value);
        }
        public float Thickness
        {
            get => Convert.ToSingle(GetPropertyValue());
            set => SetPropertyValue(value);
        }
        public int PageIndex
        {
            get => Convert.ToInt32(GetPropertyValue());
            set => SetPropertyValue(value);
        }
        public float Opacity
        {
            get => Convert.ToSingle(GetPropertyValue());
            set => SetPropertyValue(value);
        }
        public PdfAnnotationPopupWrapper AnnotationPopup
        {
            get
            {
                var obj = GetPropertyValue();
                if (obj == null)
                    return null;
                return new PdfAnnotationPopupWrapper(obj);
            }
        }
        public System.Windows.Media.Color BackgroundColor
        {
            get => (System.Windows.Media.Color)GetPropertyValue();
            set => SetPropertyValue(value);
        }
        public RectangleF[] Bounds
        {
            get => GetPropertyValue() as RectangleF[];
            set => SetPropertyValue(value);
        }
        public string Text
        {
            get => GetPropertyValue()?.ToString();
            set => SetPropertyValue(value);
        }
        public RectangleF PopupBounds
        {
            get => (RectangleF)GetPropertyValue();
            set => SetPropertyValue(value);
        }
    }
}
